package com.itheima.utiils;


import org.aspectj.lang.annotation.After;
import org.aspectj.lang.annotation.Aspect;
import org.springframework.stereotype.Component;

@Component
@Aspect
public class MyEnhancer {

    public void before() {
        System.out.println("前置方法 执行");
    }

    public void afterReturing() {
        System.out.println("后置方法 执行");
    }

    @After("execution(* com.itheima.servive.*.*.*(..))")
    public void around() {

        try {
            System.out.println("前置通知");

            System.out.println("后置通知");
        } catch (Exception e) {

            e.printStackTrace();
            System.out.println("异常通知");

        } finally {

            System.out.println("最终通知");

        }

    }

}
